<HTML><H1>Stasis 1.10 Manual</H1>

Stasis is a module occupying about 11K which provides an easy to use sound
system for games programmers.  Stasis plays samples, which it can load and
save in various ways.  Sound commands are issued in the normal way.  There
are facilities to retune samples to a different pitch if necessary. 
Primitive pitch/volume slides are included.

<H1>Loading the Module</H1>

There are many ways - double clicking the application, *Run the
application, *RMLoad Stasis:Stasis once the filer has seen the application,
or whatever you can engineer for yourself.

<H1>Using Stasis</H1>

The simplest (and probably the best) way to use Stasis is to load samples
using the *StasisLoad command, choose which channel plays which sample with
*StasisLink, and the play them with SOUND command (from BASIC) or Sound SWIs.

<H1>Loading Your Sounds</H1>

  Stasis can load samples in either its native format (which will be extended
in the future) or Tracker format (provided so that samples can be exchanged
with other packages).  The command is *StasisLoad &lt;slot> &lt;filename>.  Stasis
currently provides 64 slots, each of which can contain one sample.  The
&lt;slot> parameter is a decimal number 0-63.  Stasis now supports alien file
format modules.  If StasisDvox is loaded then Stasis will be able to load
DataVox format samples.

<H1>Checking that Youve Loaded Your Samples</H1>

  The command *StasisCat will list details of the first 16 sample slots. 
*StasisCat 0 63 lists them all.  *StasisInfo &lt;slot> provides information on
a sample in a specified slot, and *StasisState &lt;channel> provides (rather
technical) info on a sound channel. 

<H1>Playing your Samples</H1>

  To get a sound from the module, you need to tell it which sample to play on
which channel.  The command is *StasisLink &lt;channel> &lt;slot>.  The channel is
the conventional 1-8 as used by the RISC OS sound system.  The slot should be
the same number that you told *StasisLoad when you loaded your sample.  Note
that you dont need to attach channels (using *ChannelVoice etc) as Stasis
claims the channel when you issue a *StasisLink command.

  If you need things to happen a bit more quickly, use the < ahref="swidocs#link">Stasis_Link</a> SWI. 
R0,R1 hold the parameters channel,slot.  The SWI doesnt attach the voice -
make sure you use a *StasisLink command or the <a href="swidocs#attach">Stasis_Attach</a> SWI at least
once for each channel to do this.

  Once a sample is linked to a channel, it can be played using conventional
sound commands.  The duration of the sound (the fourth number in a SOUND
command) is ignored, and should be zero for future compatibility.

  Theres also the Stasis_Sound SWI which has the advantage that it can be
called from an interrupt routine.

<H1>Examples</H1>

  If a Stasis sample is double clicked on the Desktop, it will be loaded into
slot 1 and you should hear it.

  You can also try the following, using slot 2 as an example, from the
command line (press F12):

*StasisLoad 2 &lt;filename>
*StasisLink 1 2

  and then press ctrl-G. Providing the file exists and the sound system is
working, you should hear a sound.  If not, try the commands *Audio On,
*Speaker On or *Volume 127 to see if that helps.

In BASIC, you could try:

*StasisLoad 1 &lt;filename>
*StasisLink 1 1

and whenever you need to make a sound

SOUND 1,-15,40,0  - for a pitch of 40.

  Entering the command *StasisCat should show whether you have loaded any
samples.

<H1>Slides</H1>

Stasis supports both volume and pitch slides.  The command is of the form

*StasisSlide &lt;channel> &lt;type> &lt;target> &lt;time>

For example:

*StasisSlide 1 0 0 100

will slide channel 1s volume down to zero in 100 centiseconds, and the
command

*StasisSlide 1 1 &amp;3555 200

will slide the pitch to &amp;3555 in 200 centiseconds.


<H1>Further Commands</H1>
================

The above instructions should be all that you need to use sound in games
etc.  If you are writing a program to produce samples then you may need to
use the command *StasisSample.  *StasisSample &lt;slot> &lt;start address> &lt;sample
length> tells Stasis to use the block of memory at the specified address as
data.  Whilst the slot is a decimal number, the other parameters are in hex. 
A further two parameters may be added to specify a repeat offset (from the
start of the sample) and repeat length.  This is how looped samples work - a
section is repeated again and again.  See the technical file in this
directory for more details.

<H1>Saving Samples</H1>

Samples must be saved individually, and may be saved in either of two
formats.  The command StasisSave &lt;slot> &lt;filename> will save a sample in
Stasis format.  The advantages are :

   The sample responds to double clicking on the desktop.
   The finetune value is saved.
   The file is a bit shorter.

The command StasisSave &lt;type> &lt;slot> &lt;filename> saves the sample in Tracker
or other formats, depending on which alien format modules are loaded.  The
advantages are :

   The sample can then be altered with other software packages.

  All alien formats can be reloaded by Stasis whilst the alien format module
is present.

<H1>Generally Messing About</H1>

  Two more commands can be used to retune the sound system.  Firstly
*StasisFineTune, which will retune a certain sample in a slot to a different
pitch.  The finetune information is saved if the sample is saved in Stasis
format.  The command *StasisTune sets the master tuning of the module, which
affects all samples and is never saved.  The normal value for both is &amp;4000. 
Tuning values are hexadecimal.

  A sample can be renamed with *StasisName &lt;slot> &lt;name> where the name is up
to 20 letters long.

<H1>Condtions of Use</H1>

  This version of Stasis may be freely used and distributed for commercial or
non-commercial applications.  If you can distribute the whole application
with your software then so much the better, but otherwise just include
whatever you need.  You must not remove my copyright notice from the module.

  This software is supplied as is, and no liability will be accepted for loss
or damage of any kind arising from its use or misuse.

Andy Southgate, 5th Nov 1993, 20th Jan 1995, 7th August 1995.
</HTML>